/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.bean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ZULLY
 */
@Entity
@Table(name = "tipos_banda_neumatico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TiposBandaNeumatico.findAll", query = "SELECT t FROM TiposBandaNeumatico t"),
    @NamedQuery(name = "TiposBandaNeumatico.findById", query = "SELECT t FROM TiposBandaNeumatico t WHERE t.id = :id"),
    @NamedQuery(name = "TiposBandaNeumatico.findByNombre", query = "SELECT t FROM TiposBandaNeumatico t WHERE t.nombre = :nombre"),
    @NamedQuery(name = "TiposBandaNeumatico.findByEstado", query = "SELECT t FROM TiposBandaNeumatico t WHERE t.estado = :estado")})
public class TiposBandaNeumatico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @Column(name = "estado")
    private boolean estado;
    @OneToMany(mappedBy = "idBanda", fetch = FetchType.LAZY)
    private List<Neumaticos> neumaticosList;
    @OneToMany(mappedBy = "idNuevoTipoBanda", fetch = FetchType.LAZY)
    private List<DetalleControlReencauche> detalleControlReencaucheList;

    public TiposBandaNeumatico() {
    }

    public TiposBandaNeumatico(Integer id) {
        this.id = id;
    }

    public TiposBandaNeumatico(Integer id, String nombre) {
        this.id = id;
        this.nombre = nombre;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }
    
    public boolean getEstado() {
        return estado;
    }

    public void setEstado(boolean estado) {
        this.estado = estado;
    }

    @XmlTransient
    public List<Neumaticos> getNeumaticosList() {
        return neumaticosList;
    }

    public void setNeumaticosList(List<Neumaticos> neumaticosList) {
        this.neumaticosList = neumaticosList;
    }

    @XmlTransient
    public List<DetalleControlReencauche> getDetalleControlReencaucheList() {
        return detalleControlReencaucheList;
    }

    public void setDetalleControlReencaucheList(List<DetalleControlReencauche> detalleControlReencaucheList) {
        this.detalleControlReencaucheList = detalleControlReencaucheList;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TiposBandaNeumatico)) {
            return false;
        }
        TiposBandaNeumatico other = (TiposBandaNeumatico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nombre;
    }
    
}
